home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Tools / TASM V5 / TASMDOC.PAK / TSM_HELP.TXT < prev    next >
Encoding:
Text File  |  1996-02-21  |  10.2 KB  |  237 lines

  1. /*************************************************************************/
  2.                            TSM_HELP.TXT
  3.                           TURBO ASSEMBLER
  4.  
  5. This file contains answers to common questions concerning Turbo Assembler.
  6.  
  7.  Q. When should I use the different assembly modes TASM provides
  8.     for existing assembly programs?
  9.  A. Mode                   Conditions for Use
  10.     -------------------------------------------------------------
  11.     Normal(MASM)         - Program assembles under MASM 4.00 or
  12.                            MASM 5.00.
  13.     Quirks               - Program assembles under MASM 4.00 or
  14.                            MASM 5.00, but won't assemble under
  15.                            TASM without MASM51 or QUIRKS.
  16.     Masm51               - Program requires MASM 5.1 for assembly.
  17.     Masm51 and Quirks    - Program requires MASM 5.1 for
  18.                            assembly, but will not assemble
  19.                            under TASM with only the MASM51
  20.                            switch set.
  21.  
  22.  Q. Do I have to use MASM51 to assemble files written for MASM
  23.     5.1?
  24.  A. Most files will assemble even without using the MASM51
  25.     directive. However if your assembly code utilizes features
  26.     only found in MASM 5.1, you will need to use the MASM51 mode.
  27.     Check the table in the next Q&A to see which features of MASM51
  28.     emulation are enabled by combinations of MASM51 and QUIRKS
  29.     modes.
  30.  
  31.  Q. What items are controlled by the QUIRKS and MASM51 modes?
  32.  A. The following table lists what the various combinations of
  33.     QUIRKS and MASM51 modes do:
  34.  
  35.     Mode                   Operations
  36.     -------------------------------------------------------------
  37.     Quirks               - Allows FAR jumps to be generated as
  38.                            NEAR or SHORT if CS assumes agree.
  39.                          - Allows all instruction sizes to be
  40.                            determined in a binary operation solely
  41.                            by a register, if present.
  42.                          - Destroys OFFSET, segment override,
  43.                            etc., information on '=' or numeric 'EQU'
  44.                            assignments.
  45.                          - Forces EQU assignments to expressions
  46.                            that contain "PTR" or ":" to be text.
  47.  
  48.     Masm51               - Instr, Catstr, Substr, Sizestr, and
  49.                            "\" line continuation are all enabled.
  50.                          - EQU's to keywords are made TEXT
  51.                            instead of ALIASes.
  52.                          - Leading whitespace is not discarded
  53.                            on %textmacro in macro arguments.
  54.  
  55.     Masm51 and Quirks    - Everything listed under QUIRKS above.
  56.                          - Everything listed under MASM51 above.
  57.                          - @@, @F, and @B local labels are
  58.                            enabled.
  59.                          - Procedure names are PUBLIC'ed
  60.                            automatically in extended MODELs.
  61.                          - Near labels in PROCs are redefinable
  62.                            in other PROCs.
  63.                          - "::" operator is enabled to define
  64.                            symbols that can be reached outside of
  65.                            current proc.
  66.  
  67.     Masm51 and Ideal     - Ideal mode syntax and the Masm51 text
  68.                            macro directives are supported, i.e.,
  69.                            Instr, Catstr, Substr, and Sizestr.
  70.  
  71.   Q. When should I use the DOSSEG or .STACK directives?
  72.   A. When you're developing Turbo Assembler modules to link with
  73.      high-level languages like Turbo C++ and Turbo Pascal, you
  74.      don't need the DOSSEG or .STACK directives because these
  75.      compilers will handle segment-ordering and stack setup.
  76.      These directives define segment names and order that might
  77.      conflict with those used by the high-level language. You
  78.      only need, however, to define these once in any module of a
  79.      standalone assembler program. DOSSEG is only needed if you
  80.      want your segments to be ordered using Microsoft's
  81.      conventions. You can define your own segment-ordering by
  82.      ensuring that your segments are encountered by TLINK in the
  83.      order that you wish. See the TLINK section of the manual for
  84.      a full description of how this works.
  85.  
  86.   Q. What options should I use when I use Turbo Assembler to
  87.      assemble the files that came with the Microsoft C Compiler?
  88.   A. When assembling the assembly language modules provided with the
  89.      Microsoft compilers, make sure to use the MASM51 and QUIRKS
  90.      modes. For example,
  91.  
  92.        tasm /jmasm51 /jquirks filename
  93.  
  94.   Q. How do I create a .COM file?
  95.   A. Your assembler source should be assembled in the tiny model
  96.      (.MODEL TINY) and should include an ORG 100h following the
  97.      opening of the code segment, as shown below:
  98.  
  99.                 .MODEL  TINY
  100.                 .CODE
  101.                 ORG     100h
  102.         start:
  103.                 ....          ; body of program
  104.         END     start         ; defines the entry point as start
  105.  
  106.      Don't include a .STACK directive in a program designed to be
  107.      a .COM.
  108.  
  109.      TLINK will create a .COM file instead of an .EXE file if the /t
  110.      option is specified. For example,
  111.  
  112.         tlink /t SHOW87
  113.  
  114.      will create SHOW87.COM instead of SHOW87.EXE.
  115.  
  116.      There are certain limitations in converting an .EXE file to a
  117.      .COM file. These limitations are documented in the IBM Disk
  118.      Operating System manual under EXE2BIN.
  119.  
  120.   Q. How do I assemble multiple files with Turbo Assembler?
  121.   A. Turbo Assembler will assemble multiple files using wildcard
  122.      characters or separating them by the plus (+) character.
  123.      As an example, the following command line
  124.  
  125.        tasm filt + o*
  126.  
  127.      would assemble the file FILT.ASM, as well as all the .ASM
  128.      files beginning with the letter 'o'.
  129.  
  130.   Q. How can I assemble multiple files if they don't all use the
  131.      same command-line options?
  132.   A. Turbo Assembler uses the semicolon (;) character as a
  133.      command-line separator so that you can actually have
  134.      multiple assembler command lines on a single DOS command
  135.      line. As an example, the following command line
  136.  
  137.        tasm /zi filt; o*
  138.  
  139.      would assemble the file FILT.ASM with debug information
  140.      turned on, then assemble all the .ASM files beginning with
  141.      the letter 'o' without debug information.
  142.  
  143.   Q. Microsoft's Macro Assembler allows me to define environment
  144.      variables so I don't have to enter them on every command
  145.      line. Can I do this with Turbo Assembler as well?
  146.   A. No, but Turbo Assembler provides an even more flexible way
  147.      to eliminate typing in command-line options every time.
  148.      Whenever you run Turbo Assembler, it looks in the current
  149.      directory, then in the directory from which it was started
  150.      (DOS 3.x and greater) for a special file called TASM.CFG.
  151.      This file can contain anything that the command line
  152.      contains. This file is processed first and then the command
  153.      line so that the command-line options take priority over
  154.      those found in the TASM.CFG configuration file. If, for
  155.      instance, your command-line options are always
  156.  
  157.        /t /ml /zi /jJUMPS /jLOCALS
  158.  
  159.      you could create TASM.CFG file containing these lines
  160.  
  161.        /t
  162.        /ml
  163.        /zi
  164.        /jJUMPS
  165.        /jLOCALS
  166.  
  167.      Now, every time you run Turbo Assembler, those will be the
  168.      default options. This means that, if you need to, you can
  169.      have separate TASM.CFG files for each of your projects. If
  170.      you have multiple projects residing in a single subdirectory,
  171.      then you could create a separate configuration file for each
  172.      and use them as Turbo Assembler indirect command files.
  173.  
  174.   Q. What are Turbo Assembler indirect command files?
  175.   A. These are files that contain partial or complete Turbo
  176.      Assembler command lines and are preceded with an at-sign (@)
  177.      on the command line. For example, if you have a file named
  178.      "FILE.CMD" that contains the following,
  179.  
  180.        /t
  181.        /ml
  182.        /zi
  183.        /jJUMPS
  184.        /jLOCALS
  185.        file1 +
  186.        file2 +
  187.        file3 +
  188.        file4
  189.  
  190.      then you could use the command line
  191.  
  192.        tasm @FILE.CMD
  193.  
  194.      instead of the command line
  195.  
  196.        tasm /t /ml /zi /jJUMPS /jLOCALS file1+file2+file3+file4
  197.  
  198.      Note that the at-sign (@) is not actually part of the file's
  199.      name. In fact, if you name a file with an at-sign at the
  200.      beginning, Turbo Assembler will treat it as an indirect
  201.      command file.
  202.  
  203.   Q. I am linking my own assembly language functions with Turbo C.
  204.      Why does the linker report that all of my functions are
  205.      undefined?
  206.   A. Make sure you've put an underbar character (_) in front
  207.      of all assembly language function names to be called
  208.      by Turbo C. If you use simplified segmentation and include
  209.      the C language specifier on the .MODEL directive, Turbo
  210.      Assembler will pre-append the underbar automatically for you.
  211.      Your assembly language program should be assembled with Case
  212.      Sensitivity (/ML or /MX). 
  213.  
  214.   Q. Can I use the backslash (\) instead of the slash (/) as a
  215.      option specifier?
  216.   A. NO! Turbo Assembler (and MASM) will treat that as a file
  217.      that resides in the root directory of the default drive.
  218.      Since both assemblers treat the space character ( ) as a
  219.      comma (,) this could result in the loss of files. If you
  220.      accidentally gave this command line,
  221.  
  222.       tasm \zi prid&joy.asm
  223.  
  224.      Turbo Assembler (and MASM) would treat this command line as
  225.      instructions to assemble a file called ZI.ASM that can be
  226.      found in the root directory and create an output file in the
  227.      current directory called PRID&JOY.ASM. (Note that the
  228.      assemblers think the default extension for the object file
  229.      of .OBJ has been explicitly overridden to .ASM.) The file
  230.      PRID&JOY.ASM will either be overwritten with the object file
  231.      or deleted if the file \ZI.ASM can't be found and success-
  232.      fully assembled. In either case, the original contents of
  233.      PRID&JOY.ASM are now lost.
  234.  
  235. /**************************** END OF FILE ********************************/
  236.  
  237.